package com.example2;

import javax.swing.*;
import java.awt.*;

/**
 * @author Yancy
 * @program springioctest
 * @create 2020-08-31
 */
public class Demo02 {
  public static void main(String[] args) {
    //
      JFrame frame = new JFrame("JFrameDemo02");
      Container contentPane = frame.getContentPane();
      contentPane.setBackground(Color.cyan);
      JPanel panel = new JPanel();
      panel.setBackground(Color.yellow);
      JButton button = new JButton("press me");
      panel.add(button);
      contentPane.add(panel,BorderLayout.SOUTH);
      frame.setSize(300,299);
      frame.setVisible(true);
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  }
}
